7 CLEAR ,,2048
10 WH$="mbMLL64T255O2ABL4T64O3CL45T255O2A-A+BCO4L3T60CL45T255O2ABL4T64O3C"
15 DE$="mbt255l64o2ba#ag#gf#fed#dc#c"
17 UP$="mbl32t36o2cc#dd#eff#gg#aa#b":DIM LN(39)
20 TITLE$="  BATALLA   NAVAL  ":BY$=" MICRO SISTEMAS S.A."
30 DEF SEG=&H40:RANDOMIZE PEEK(&H6D)*256!+PEEK(&H6C)-32768!
35 DEF SEG=&H4F:MON=PEEK(3)
37 IF MON<>1 THEN YW=7:RW=7:BRW=7:CW=7:GW=7:LBW=7:BW=7 ELSE YW=14:RW=4:BRW=6:CW=3:GW=2:LBW=9:BW=0
38 IF MON=0 THEN BB=0 ELSE BB=1
40 SCREEN ,,0,0:COLOR YW,BB,BB
42 CLS
43 COLOR CW:LOCATE 4,1:PRINT STRING$(40,"~")
44 LOCATE 20,1:PRINT STRING$(40,219)
50 U=1:V=1:FOR I=1 TO 7:GOSUB 490:U=I:V=I+4:NEXT:S=1:T=8:Q=4:FOR I=8 TO 26:TTL$=MID$(TITLE$,S,1)
53 GOSUB 490:IF TTL$<>" " THEN GOSUB 495:PLAY "xde$;":LOCATE R,J,0:PRINT TTL$;
55 U=I:V=I+4:S=S+1:NEXT:FOR I=27 TO 33:GOSUB 490:U=I:V=I+4:NEXT
60 LOCATE 1,U:PRINT SPACE$(8):LOCATE 2,U:PRINT SPACE$(8):LOCATE 3,U:PRINT SPACE$(8)
110 U=1:V=1:FOR I=1 TO 6:GOSUB 490:U=I:V=I+4:NEXT:S=1:FOR I=7 TO 27:B$=MID$(BY$,S,1):Q=4:T=8:GOSUB 490
120 IF B$<>" " THEN GOSUB 495:PLAY "xde$;":Q=11:T=15:GOSUB 495:LOCATE R,J,0:PRINT B$
130 U=I:V=I+4:S=S+1:NEXT:FOR I=28 TO 33:GOSUB 490:U=I:V=I+4:NEXT
280 LOCATE 1,U:PRINT SPACE$(8):LOCATE 2,U:PRINT SPACE$(8):LOCATE 3,U:PRINT SPACE$(8):X=11:GOSUB 300:X=12:GOSUB 310:X=13:GOSUB 320:X=14:GOSUB 330:GOTO 340
300 COLOR 7,BB:LOCATE X,7,0:PRINT"           ¸ÝÛ                ":RETURN
310 COLOR 7,BB:LOCATE X,7:PRINT"          Í";:COLOR 0,7:PRINT "ùùùù";:COLOR 7,BB:PRINT "©              ":RETURN
320 COLOR 7,BB:LOCATE X,7:PRINT"  · \Ü \Ü©";:COLOR 0,7:PRINT "ùùùùùù";:COLOR 7,BB:PRINT "Ü Ü/ Ü/       ":RETURN
330 COLOR 7,BB:LOCATE X,7:COLOR 0,7:PRINT"  úú  úúú     úúú  úúú   ";:COLOR 7,BB:PRINT CHR$(16):RETURN
340 COLOR 0,7:LOCATE 14,31:PRINT "|"
350 COLOR BW,BB:FOR J=15 TO 19:LOCATE J,31:PRINT ":":NEXT:COLOR 0,CW:LOCATE 20,31:PRINT "v":GOSUB 450:PLAY "xup$;"
355 LOCATE 20,31:PRINT " ":COLOR BW,BB:LOCATE 19,31:PRINT "v":GOSUB 450
360 COLOR BW,BB:FOR J=18 TO 15 STEP -1:LOCATE J+1,31:PRINT " ":LOCATE J,31:PRINT "v":GOSUB 450:NEXT
370 LOCATE 15,31:PRINT " ":COLOR 0,7:LOCATE 14,31:PRINT "v":GOSUB 450:PLAY "xwh$;"
380 FOR J=1 TO 5:FOR I=50 TO 800 STEP 20:SOUND I,.3:NEXT:NEXT
390 GOTO 470
450 FOR I=1 TO 500:NEXT:RETURN
470 COLOR 7,BB:LOCATE 22,1,0:PRINT"                          "
475 LOCATE 23,1:PRINT"                                  "
480 LOCATE 25,1:PRINT "Presione "CHR$(17)CHR$(196)CHR$(217)" cuando este listo..";:GOSUB 5000:GOTO 510
490 J=I+2:LOCATE 1,U,0:PRINT "   ":LOCATE 2,U,0:PRINT "   ":LOCATE 3,U,0:PRINT "  ";
491 COLOR 7,BB:LOCATE 1,J,0:PRINT"Úî"
492 LOCATE 2,J:COLOR 0,7:PRINT "ú";:COLOR 7,BB:PRINT "Ü©Ü/"
493 LOCATE 3,I:PRINT " ";:COLOR 0,7:PRINT"     v";:COLOR 7,BB:PRINT CHR$(16):RETURN
495 COLOR YW:FOR R=Q TO T:LOCATE R,J,0:PRINT CHR$(219)
496 LOCATE R,J:IF R=4 THEN COLOR CW:PRINT "~" ELSE COLOR YW:PRINT " "
497 NEXT:RETURN
500 ERASE X,Y0,Y1,M0,M1,TABLE:PLAY1$="":PLAY2$=""
510 DIM X(10,10),Y0(10,10),Y1(10,10),M0(10,10),M1(10,10),TABLE(100)
540 CLS:PRINT "  ........ BIENVENIDOS ........":PRINT:PRINT STRING$(15,32);"A LA":PRINT:PRINT "      *** BATALLA NAVAL ***   ";:LOCATE 9,1:PRINT "Hay 3 formas de jugar BATALLA NAVAL:":PRINT:PRINT " 1.) Ud. juega contra mi!"
550 PRINT "     (Trata de destruir mis naves.)":PRINT:
560 PRINT " 2.) Ud. y Yo jugamos en contra. !!!!"
565 PRINT "     (Ambos ocultamos naves.     )":PRINT:
590 PRINT " 3.) Ud. y un amigo juegan a destruirse":PRINT "     las naves. !!":
600 PRINT "    (Ambos ocultan sus naves, entonces":PRINT "    tratan de hundir cada nave enemiga)":PRINT
610 GOSUB 22000
620 LOCATE ,,1:PRINT "Tipee el nro de la opcion que desee : ";:GOSUB 5500
621 IF OPT<>1 THEN 2010 ELSE LOCATE 24,13,0:PRINT "Espere un momento ...";
805 MUS$="mbl64t255cc#dd#eff#gg#aa#b":D$=",":YSHOTS=0:YSTRIKES=0:MUSFG=0:SW4=0:YA1=0:YA2=0:YD1=0:YD2=0:YD3=0:YB=0
806 M1$="Ingrese su disparo  (f,c): ":BAK=BB
810 FOR P=1 TO 4
830 I=INT(10*(RND+.1)):J=INT(10*(RND+.1)):IF X(I,J)<>0 THEN 830 ELSE X(I,J)=1:NEXT
840 FOR SHIP=2 TO 4:S=2:GOSUB 1690:NEXT:FOR SHIP=5 TO 6:S=3:GOSUB 1690:NEXT:S=4:SHIP=7:GOSUB 1690:GOSUB 4090
850 CLS:LOCATE 10,1:PRINT "Ingrese su nombre:"
855 LOCATE 11,1,1:PRINT "(max. 8 letras)   ";
856 LOCATE 12,1:PRINT"y presione "CHR$(17)+CHR$(196)+CHR$(217)" p/continuar";:LOCATE 10,24
860 CL=10:CC=24:GOSUB 8000
865 NAM$=I$+"'s"
870 CLS:PRINT " "I$;", Yo estoy lista para su ":PRINT" ataque!!":PRINT:PRINT " Mi flota consiste de:":GOSUB 2810:
872 PRINT " Haga sus disparos tipeando el nro.":PRINT" de fila y el nro de columna, separados":PRINT" por una coma. Y presione "CHR$(17)CHR$(196)CHR$(217)" p/continuar"
875 PRINT:PRINT" Todas las naves estan en forma ":PRINT" Horizontal o Vertical."
880 PRINT " NUNCA en diagonal!":PRINT:PRINT" Esta listo para jugar !!"
930 PRINT:PRINT " Presione "CHR$(17)+CHR$(196)+CHR$(217)" cuando este listo y el  "
940 PRINT " tablero aparecera.";:GOSUB 5000
960 CLS:GOSUB 3340
1000 COLOR 7,BB:LOCATE 24,26:PRINT SPACE$(12);:LOCATE 23,2,1:PRINT:PRINT M1$;:GOSUB 1160:LOCATE 24,27:GOSUB 7000
1001 SW4=0:LOCATE 25,1,0:PRINT SPACE$(39);:GOSUB 1160:YSHOTS=YSHOTS+1:IF X(X,Y)<>0 THEN U=X:V=Y:GOSUB 3260:GOTO 1120
1002 IF M0(X,Y)=0 THEN X(X,Y)=9:GOTO 1080
1010 X(X,Y)=M0(X,Y):YSTRIKES=YSTRIKES+1:GOSUB 1160:I=X:J=Y:GOSUB 3380
1020 IF X(X,Y)=7 THEN YB=YB+1:IF YB<4 THEN 1120 ELSE GOSUB 3590:GOTO 1120
1025 IF X(X,Y)=6 THEN YA2=YA2+1:IF YA2<3 THEN 1120 ELSE GOSUB 3590:GOTO 1120
1030 IF X(X,Y)=5 THEN YA1=YA1+1:IF YA1<3 THEN 1120 ELSE GOSUB 3590:GOTO 1120
1035 IF X(X,Y)=4 THEN YD3=YD3+1:IF YD3<2 THEN 1120 ELSE GOSUB 3590:GOTO 1120
1040 IF X(X,Y)=3 THEN YD2=YD2+1:IF YD2<2 THEN 1120 ELSE GOSUB 3590:GOTO 1120
1045 IF X(X,Y)=2 THEN YD1=YD1+1:IF YD1<2 THEN 1120 ELSE GOSUB 3590:GOTO 1120
1050 IF X(X,Y)=1 THEN 1120
1080 I=X:J=Y:GOSUB 3380
1120 IF YSTRIKES=20 THEN 1840 ELSE GOTO 1000
1160 IF SW4=1 THEN RETURN ELSE HR=0:IF YSHOTS>0 THEN HR=YSTRIKES/YSHOTS
1162 COLOR 7,BB:LOCATE 25,1,0:PRINT "Su promedio   =";:PRINT USING "#.###";HR;:RETURN
1690 K=RND:GOSUB 1710:RETURN
1700 I=INT(10*(RND+.1)):J=INT(10*(RND+.1)):IF X(I,J)<>0 THEN 1700 ELSE RETURN
1710 GOSUB 1700:R=S:IF R<=0 THEN RETURN ELSE IF K>.5 THEN 1760 ELSE L=I
1720 IF X(I,J)<>0 THEN 1710 ELSE I=I+1:R=R-1
1730 IF R>0 THEN IF I>10 THEN 1710 ELSE GOTO 1720
1740 R=S:I=I-1
1750 X(I,J)=SHIP:R=R-1:I=I-1:IF R>0 THEN 1750 ELSE RETURN
1760 L=J
1770 IF X(I,J)<>0 THEN 1710
1780 J=J+1:R=R-1:IF R>0 THEN IF J>10 THEN 1710 ELSE GOTO 1770
1790 R=S:J=J-1
1800 X(I,J)=SHIP:R=R-1:J=J-1:IF R>0 THEN 1800 ELSE RETURN
1810 FOR J=1 TO 10
1820 FOR I=1 TO 10
1830 M0(I,J)=X(I,J):X(I,J)=0:NEXT:NEXT:RETURN
1840 Y$="Ud esta derrotado":COLOR 7,BB:LOCATE 24,1:PRINT "Presione "CHR$(17)CHR$(196)CHR$(217)" p/ continuar !!";:GOSUB 5000:CLS:LOCATE 5,11:PRINT Y$:LOCATE 15,7:PRINT "COMPUTADOR PERSONAL MS-61":LOCATE 18,7
1850 PRINT "Sus disparos =";YSHOTS:YR=0
1900 YR=CINT((YSTRIKES/YSHOTS)*100):LOCATE 19,7:PRINT "Aciertos     =";YSTRIKES:LOCATE 20,7:PRINT "Promedio     =":LOCATE 20,22:PRINT USING "##";YR;:PRINT "%":LOCATE 23,1:PRINT "Juega de nuevo (S/N)? ";:GOSUB 9000:IF C$="S" THEN 500 ELSE 11000
2000 REM  originally highsea1
2010 C1=0:IB$="COMPUTADOR PERSONAL MS-61":P$="Presione "+CHR$(17)+CHR$(196)+CHR$(217)+ " para continuar ...":E1$="ERROR- Celda ocupada. Pruebe de nuevo.":S$="Aciertos  =":H$="Porcentaje ="
2020 E4$="ERROR- Celda no valida. Pruebe de nuevo.":M1$="Tipee su nombre: ":M2$="(max. 8 letras) "
2030 SW2=0:SW3=0:SW4=0:SW5=0:CLS:NM$="'s":IF OPT=3 THEN 2090
2040 CLS:LOCATE ,,0:PRINT "  Espere un momento mientras oculto mis naves.":PRINT "  Luego, usted ocultara sus naves, ":PRINT "  tambien.               "
2045 FOR P=1 TO 100
2050 I=INT(RND*100)+1
2060 IF TABLE(I)<>0 THEN 2050
2062 TABLE(I)=P
2064 NEXT
2070 LOCATE 16,3,0:PRINT "Ingrese su nombre  :";:LOCATE 17,3:PRINT M2$;:LOCATE 18,3:PRINT"presione " CHR$(17)+CHR$(196)+CHR$(217)" p/continuar...":LOCATE 16,26,1:CL=16:CC=26:GOSUB 8000
2080 LOCATE 19,1,0:PRINT SPACE$(39):PLAY1$=I$+NM$:NAM$=PLAY1$
2090 MA1=0:MA2=0:MD1=0:MD2=0:MD3=0:YA1=0:YA2=0:YD1=0:YD2=0:YD3=0
2095 'ya1-5, ya2-6, yd1-2, yd2-3, yd3-4
2100 I=0:J=0:I1=0:J1=0:U=0:V=0:Q=0:R=0:YSTK1=0:MSTK1=0:MB=0:YB=0:MSHOTS=0:YSHOTS=0:MSTRIKES=0:YSTRIKES=0:F3=0:STRIKEFG=0:F0=0:F1=0:F2=0:MUSFG=0:TABIND=1:D$=",":MUS$="mbl64t255cc#dd#eff#gg#aa#b":F=0:IF OPT=3 THEN 2820
2105 FOR P=1 TO 4
2110 SHIP=1:GOSUB 3700:X(I,J)=1:NEXT:FOR SHIP=2 TO 4:S=2:GOSUB 3690:NEXT:FOR SHIP=5 TO 6:S=3:GOSUB 3690:NEXT:SHIP=7:S=4:GOSUB 3690:GOSUB 4090
2120 CLS:PRINT " Ya estoy lista para que construya su":PRINT " flota. Recuerde lo siguiente:      ":GOSUB 2810:PRINT " El objeto del juego es que usted    ":PRINT " destruya mi flota antes que yo la suya.":PRINT " Pero primero posicione su flota."
2130 PRINT" Le indicare el momento de comienzo":PRINT" al ubicar cada nave.  Tipee la fila":PRINT" y columna elegidas, separadas por ":PRINT" coma; y presione "CHR$(17)CHR$(196)CHR$(217)". Las naves":PRINT" podran ubicarse en forma Horizontal o"
2131 PRINT" Vertical."
2135 PRINT:PRINT" RECUERDE: Recibira 1(un) disparo  ":PRINT " extra por cada nave que destruya!!!"
2140 PRINT:PRINT " Preparese le voy a GANAR!. Presione "CHR$(17)+CHR$(196)CHR$(217):PRINT " - Y aparecera el tablero !!!";:GOSUB 5000
2150 CLS:GOSUB 3970:GOSUB 4060:COLOR 7,BB,BB:CLS:PRINT " Estamos listos para jugar.  Usted      ";:PRINT " tendra el primer disparo!  Recuerde:":GOSUB 2810:PRINT " Las naves estan en forma HORIZONTAL o VERTICAL!!":PRINT:PRINT " y, por favor observe los"
2160 PRINT " mensajes!!!":PRINT:PRINT " RECUERDE: Ud. recibe 1 tiro extra por ":PRINT SPACE$(11);"cada nave que destruya!"
2165 SCREEN ,,1,0:NAM$=PLAY1$:COLOR 7,BB:CLS:GOSUB 3340
2167 SCREEN ,,2,0:NAM$="MS-61":CLS:GOSUB 3340:SCREEN ,,0,0
2170 SW4=0:COLOR 7,BB:LOCATE 24,2,0:PRINT P$;:GOSUB 5000:YSTK=YSTK1+1:LOCATE 24,1,0:PRINT SPACE$(39);
2180 SCREEN ,,1,1:BAK=BB:COLOR ,,BAK
2190 COLOR 7,BB:ST=YSTK:SW5=1:GOSUB 3290:GOSUB 3200:YSHOTS=YSHOTS+1:IF Y1(U,V)=9 THEN GOSUB 3260:GOTO 2210
2195 IF M0(U,V)=0 THEN 2200
2197 GOTO 2230
2198 I=U:J=V:GOSUB 3380:GOTO 2240
2200 Y1(U,V)=9:X(U,V)=9:I=U:J=V:GOSUB 3380
2210 X(U,V)=0:IF YSTRIKES=20 THEN 3950
2220 YSTK=YSTK-1:IF YSTK=0 THEN ST=YSTK:GOSUB 3290: GOTO 2300 ELSE GOTO 2190
2230 IF Y1(U,V)=M0(U,V) THEN GOSUB 3260:GOTO 2210 ELSE Y1(U,V)=M0(U,V):X(U,V)=M0(U,V):GOTO 2198
2240 IF X(U,V)=7 THEN YB=YB+1:IF YB<4 THEN 2290 ELSE GOSUB 3590:GOTO 2280
2250 IF X(U,V)=5 THEN YA1=YA1+1:IF YA1<3 THEN 2290 ELSE GOSUB 3590:GOTO 2280
2255 IF X(U,V)=6 THEN YA2=YA2+1:IF YA2<3 THEN 2290 ELSE GOSUB 3590:GOTO 2280
2260 IF X(U,V)=2 THEN YD1=YD1+1:IF YD1<2 THEN 2290 ELSE GOSUB 3590:GOTO 2280
2262 IF X(U,V)=3 THEN YD2=YD2+1:IF YD2<2 THEN 2290 ELSE GOSUB 3590:GOTO 2280
2264 IF X(U,V)=4 THEN YD3=YD3+1:IF YD3<2 THEN 2290 ELSE GOSUB 3590:GOTO 2280
2270 IF X(U,V)>1 THEN 2290
2280 YSTK1=YSTK1+1
2290 YSTRIKES=YSTRIKES+1:ST=YSTK:GOSUB 3290:GOTO 2210
2300 SW4=0:COLOR 7,BB:LOCATE 24,1,0:PRINT P$;:GOSUB 5000:MSTK=MSTK1+1:LOCATE 24,1,0:PRINT SPACE$(39);
2305 FOR JJ=1 TO 200:NEXT
2310 SCREEN ,,2,2:BAK=LBW:COLOR ,,BAK:FOR I=1 TO 500:NEXT
2320 ST=MSTK:GOSUB 3310:IF STRIKEFG>0 AND F3>0 THEN I=I1:J=J1:GOTO 2400
2330 IF TABLE(TABIND)=0 THEN TABIND=TABIND+1:GOTO 2330
2340 I=INT(TABLE(TABIND)/10):J=INT(TABLE(TABIND)-(10*I)):TABIND=TABIND+1
2350 IF I=0 THEN I=10
2360 IF J=0 THEN J=10
2370 IF Y0(I,J)=0 THEN 2380
2372 M1(I,J)=Y0(I,J):X(I,J)=Y0(I,J):GOSUB 3380:GOTO 2430
2380 M1(I,J)=9:X(I,J)=9:GOSUB 3380
2390 MSTK=MSTK-1:MSHOTS=MSHOTS+1:ST=MSTK:GOSUB 3310:X(I,J)=0
2400 IF MSTRIKES=20 THEN 3940
2410 IF M1(I,J)<9 THEN GOSUB 2500
2420 IF MSTK<=0 THEN ST=MSTK:GOSUB 3310:GOTO 2170 ELSE FOR L=1 TO 350:NEXT L:GOTO 2320
2430 IF X(I,J)=7 THEN MB=MB+1:F3=1:IF MB<4 THEN 2480 ELSE 2490
2440 IF X(I,J)=5 THEN MA1=MA1+1:F3=1:IF MA1<3 THEN 2480 ELSE 2490
2445 IF X(I,J)=6 THEN MA2=MA2+1:F3=1:IF MA2<3 THEN 2480 ELSE 2490
2450 IF X(I,J)=2 THEN MD1=MD1+1:F3=1:IF MD1<2 THEN 2480 ELSE 2490
2452 IF X(I,J)=3 THEN MD2=MD2+1:F3=1:IF MD2<2 THEN 2480 ELSE 2490
2454 IF X(I,J)=4 THEN MD3=MD3+1:F3=1:IF MD3<2 THEN 2480 ELSE 2490
2460 IF X(I,J)>1 THEN 2480
2470 MSTK1=MSTK1+1
2480 MSTRIKES=MSTRIKES+1:GOTO 2390
2490 STRIKEFG=0:F3=0:F0=0:F1=0:GOSUB 3590:GOTO 2470
2500 SHPTYPE=Y0(I,J)-1:IF SHPTYPE=0 THEN RETURN
2510 SIZE=Y0(I,J):IF F3=0 THEN RETURN
2520 F2=0:I1=I:J1=J:STRIKEFG=1:IF MSTK<=0 THEN GOSUB 3310:RETURN
2530 FOR L=1 TO 350:NEXT L:IF F0=0 AND F1=0 THEN 2550
2540 IF F0=1 THEN 2640 ELSE 2570
2550 K=RND:IF K>.5 THEN 2640
2560 F0=0:F1=1:J=J1
2570 I=I+1:IF I>10 THEN 2620
2580 IF M1(I,J)=0 THEN 2750
2590 IF F2=0 THEN IF SIZE=M1(I,J) AND I>I1 THEN 2570
2600 IF M1(I,J)<>SIZE AND I<I1 THEN 2640
2610 IF I<=I1 THEN 2630
2620 I=I-1:F2=1
2630 I=I-1:IF I>0 THEN 2580
2640 I=I1:F2=0:F0=1
2650 J=J+1:IF J>10 THEN 2710
2660 IF M1(I,J)=0 THEN 2750
2670 IF F2=0 THEN IF SIZE=M1(I,J) AND J>J1 THEN 2650
2680 IF M1(I,J)<>SIZE AND J<J1 AND F1=1 THEN 2740
2690 IF M1(I,J)<>SIZE AND J<J1 AND F1=0 THEN 2560
2700 IF J<=J1 THEN 2720
2710 J=J-1:F2=1
2720 J=J-1:IF J>0 THEN 2660
2730 IF F1=0 THEN 2560
2740 STRIKEFG=0:F3=0:F0=0:F1=0:RETURN
2750 NUM=0:IF I<10 THEN NUM=I*10
2760 IF J<10 THEN NUM=NUM+J
2770 IF NUM<=0 THEN NUM=100
2780 TAB=TABIND
2790 IF TABLE(TAB)<>NUM THEN TAB=TAB+1:IF TAB<101 THEN 2790
2800 TABLE(TAB)=0:GOTO 2370
2810 PRINT:PRINT "   4 Submarinos        (S) Longitud = 1":PRINT "   3 Destructores      (D) Longitud = 2":PRINT "   2 Portaaviones      (A) Longitud = 3":PRINT "   1 Acorazado         (B) Longitud = 4":PRINT:RETURN
2820 COLOR 7,BB,BB:CLS:LOCATE 1,1,0:PRINT " Estoy lista para que construyan    ":PRINT " sus flotas.  Cada uno tendra lo  ":PRINT " siguiente:":GOSUB 2810:PRINT " El objeto del juego es p/el jugador 1":PRINT " destruir la flota del jugador 2 antes"
2830 PRINT " que la propia sea destruida.":PRINT " Pero, primero denme la posicion de  ":PRINT" sus naves. Uds seran consultados por ":PRINT" la posicion de comienzo(fila y col.) de":PRINT" la nave, y si es horizontal o      "
2835 PRINT " vertical. Tipee los numeros de fila y ":PRINT" columna, separados por coma; luego":PRINT" presione "CHR$(17)CHR$(196)CHR$(217)
2840 PRINT:PRINT" Primero, deben decidir quien sera ":PRINT " Jugador 1 y quien Jugador 2 !!    ":LOCATE 24,2,0:PRINT P$;:GOSUB 5000:CLS
2845 PRINT " Jugador 1, ";M1$:LOCATE 2,2,0:PRINT M2$:PRINT" luego presione "CHR$(17)CHR$(196)CHR$(217):LOCATE 1,28,1:CL=1:CC=28:GOSUB 8000
2850 PLAY1$=I$:LOCATE 6,1,0:PRINT " Jugador 2, ";M1$:I$=""
2860 LOCATE 7,2,1:PRINT M2$:PRINT " luego presione "CHR$(17)CHR$(196)CHR$(217):LOCATE 6,28,1:CL=6:CC=28:GOSUB 8000:PLAY2$=I$
2870 LOCATE 11,1,0:PRINT " "PLAY2$;", Usted debera retirarse   ":PRINT " mientras ";PLAY1$;" ubica su flota!";:LOCATE 24,2,0:PRINT P$;:GOSUB 5000
2880 CLS:NAM$=PLAY1$:GOSUB 3970:GOSUB 4060:COLOR 7,BB:LOCATE 24,2,0:PRINT P$;:GOSUB 5000:CLS:PRINT " Bueno, ahora ";PLAY2$;" ubicara":PRINT " sus naves!":LOCATE 24,2:PRINT P$;:GOSUB 5000
2890 CLS:NAM$=PLAY2$:GOSUB 3970:GOSUB 4090:COLOR 7,BB:LOCATE 24,2:PRINT P$;:GOSUB 5000:CLS:PRINT " Estamos listos para comenzar.":PRINT " "PLAY1$;" realizara el primer tiro!":PRINT:PRINT " Recuerde:":GOSUB 2810
2900 PRINT " Las naves estan HORIZONTAL o VERTICAL!!":PRINT:PRINT " y, POR FAVOR observe todos los  ":PRINT " mensajes!!!":PRINT:PRINT " RECUERDE: Ud recibira 1 tiro extra por":PRINT SPACE$(11);"cada nave que destruya!"
2910 SCREEN ,,1,0:COLOR 7,BB:CLS:NAM$=PLAY1$+NM$:GOSUB 3340
2915 SCREEN ,,2,0:NAM$=PLAY2$+NM$:CLS:GOSUB 3340
2917 SCREEN ,,0,0:LOCATE 24,2,0:PRINT P$;:GOSUB 5000
2920 YSTK=YSTK1+1:SCREEN ,,1,1:BAK=BB:COLOR ,,BAK
2930 SW5=1:ST=YSTK:GOSUB 3290:GOSUB 3200:YSHOTS=YSHOTS+1
2940 IF Y1(U,V)=9 THEN GOSUB 3260:GOTO 2960
2942 IF M0(U,V)=0 THEN 2950
2944 GOTO 2980
2946 I=U:J=V:GOSUB 3380:GOTO 2990
2950 Y1(U,V)=9:X(U,V)=9:I=U:J=V:GOSUB 3380
2960 X(U,V)=0:IF YSTRIKES=20 THEN 4150
2970 YSTK=YSTK-1:IF YSTK=0 THEN ST=YSTK:GOSUB 3290:GOTO 3050 ELSE GOTO 2930
2980 IF Y1(U,V)=M0(U,V) THEN GOSUB 3260:GOTO 2960 ELSE Y1(U,V)=M0(U,V):X(U,V)=M0(U,V):GOTO 2946
2990 IF X(U,V)=7 THEN YB=YB+1:IF YB<4 THEN 3040 ELSE GOSUB 3590:GOTO 3030
3000 IF X(U,V)=5 THEN YA1=YA1+1:IF YA1<3 THEN 3040 ELSE GOSUB 3590:GOTO 3030
3005 IF X(U,V)=6 THEN YA2=YA2+1:IF YA2<3 THEN 3040 ELSE GOSUB 3590:GOTO 3030
3010 IF X(U,V)=2 THEN YD1=YD1+1:IF YD1<2 THEN 3040 ELSE GOSUB 3590:GOTO 3030
3012 IF X(U,V)=3 THEN YD2=YD2+1:IF YD2<2 THEN 3040 ELSE GOSUB 3590:GOTO 3030
3014 IF X(U,V)=4 THEN YD3=YD3+1:IF YD3<2 THEN 3040 ELSE GOSUB 3590:GOTO 3030
3020 IF X(U,V)>1 THEN 3040
3030 YSTK1=YSTK1+1
3040 YSTRIKES=YSTRIKES+1:ST=YSTK:GOSUB 3290:GOTO 2960
3050 COLOR 7,BB:LOCATE 24,1,0:PRINT P$;:GOSUB 5000:SW4=0:LOCATE 24,1,0:PRINT SPACE$(39);
3060 MSTK=MSTK1+1:SCREEN ,,2,2:BAK=LBW:COLOR ,,BAK
3070 SW5=1:ST=MSTK:GOSUB 3310:GOSUB 3200:MSHOTS=MSHOTS+1
3080 IF M1(U,V)=9 THEN GOSUB 3260:GOTO 3100
3082 IF Y0(U,V)=0 THEN 3090
3084 GOTO 3120
3086 I=U:J=V:GOSUB 3380:GOTO 3130
3090 M1(U,V)=9:X(U,V)=9:I=U:J=V:GOSUB 3380
3100 X(U,V)=0:IF MSTRIKES=20 THEN 4140
3110 MSTK=MSTK-1:IF MSTK=0 THEN ST=MSTK:GOSUB 3310:GOTO 3190 ELSE GOTO 3070
3120 IF M1(U,V)=Y0(U,V) THEN GOSUB 3260:GOTO 3100 ELSE M1(U,V)=Y0(U,V):X(U,V)=Y0(U,V):GOTO 3086
3130 IF X(U,V)=7 THEN MB=MB+1:IF MB<4 THEN 3180 ELSE GOSUB 3590:GOTO 3170
3140 IF X(U,V)=5 THEN MA1=MA1+1:IF MA1<3 THEN 3180 ELSE GOSUB 3590:GOTO 3170
3145 IF X(U,V)=6 THEN MA2=MA2+1:IF MA2<3 THEN 3180 ELSE GOSUB 3590:GOTO 3170
3150 IF X(U,V)=2 THEN MD1=MD1+1:IF MD1<2 THEN 3180 ELSE GOSUB 3590:GOTO 3170
3152 IF X(U,V)=3 THEN MD2=MD2+1:IF MD2<2 THEN 3180 ELSE GOSUB 3590:GOTO 3170
3154 IF X(U,V)=4 THEN MD3=MD3+1:IF MD3<2 THEN 3180 ELSE GOSUB 3590:GOTO 3170
3160 IF X(U,V)>1 THEN 3180
3170 MSTK1=MSTK1+1
3180 MSTRIKES=MSTRIKES+1:ST=MSTK:GOSUB 3310:GOTO 3100
3190 COLOR 7,BB:LOCATE 24,1:PRINT P$;:GOSUB 5000:SW4=0:LOCATE 24,1,0:PRINT SPACE$(39);:GOTO 2920
3200 COLOR 7,BB:LOCATE 24,26,0:PRINT SPACE$(12);:LOCATE 23,2:PRINT:PRINT "Ingrese su disparo  (f,c):";:GOSUB 3320:LOCATE 24,27,1
3210 GOSUB 7000:U=X:V=Y:LOCATE 25,1,0:PRINT SPACE$(39);:SW4=0:GOSUB 3320:RETURN
3220 GOSUB 7000:I=X:J=Y:LOCATE 25,1,0:PRINT SPACE$(39);:SW3=0:RETURN
3230 LOCATE 24,37,0:PRINT "   ";:COLOR 7,BB:LOCATE 24,1,1:PRINT "Ingrese H - Horizontal, V - Vertical:";:GOSUB 6000
3250 LOCATE 24,1,0:PRINT SPACE$(39);:RETURN
3260 LOCATE 25,1,0:PRINT SPACE$(39);:SOUND 400,4:U$=STR$(U):V$=STR$(V):U$=MID$(U$,2,LEN(U$)-1):V$=MID$(V$,2,LEN(V$)-1):LOCATE 25,1:PRINT "Perdon, ud ya disparo a ";U$;",";V$;"!";:SW4=1:RETURN
3270 LOCATE 25,1,0:SOUND 400,4:PRINT E4$;:RETURN
3280 LOCATE 25,1,0:SOUND 400,4:PRINT E1$;:RETURN
3290 HR=0:IF YSHOTS>0 THEN HR=YSTRIKES/YSHOTS:IF ST>10 THEN ST=10
3300 GOTO 3320
3310 HR=0:IF MSHOTS>0 THEN HR=MSTRIKES/MSHOTS:IF ST>10 THEN ST=10
3320 IF SW5=1 THEN SW5=0:RETURN
3330 IF SW4=1 THEN RETURN ELSE COLOR 7,BB:LOCATE 25,1:PRINT "Disparos   =";ST;"  -  Promedio  =";:PRINT USING " #.###";HR;:RETURN
3340 COLOR YW:LOCATE 2,5:PRINT:FOR P=1 TO 20:LOCATE ,5,0:PRINT CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249)"  "CHR$(249):NEXT:Q=2:FOR P=1 TO 11:LOCATE Q,5,0
3350 PRINT STRING$(31,249);:Q=Q+2:NEXT:COLOR 7,BB:LOCATE 1,3,0:PRINT " c 1  2  3  4  5  6  7  8  9  10";:LOCATE 2,2,0:PRINT "f":Q=2:FOR P=1 TO 9:LOCATE Q,3,0:Q=Q+1:LOCATE Q,1,0:PRINT " ";P:Q=Q+1:NEXT
3360 Q=Q+1:LOCATE Q,1,0:PRINT P:NLEN=LEN(NAM$)
3370 J=INT((20-NLEN)/2):FOR I=1 TO NLEN:LOCATE J,1,0:PRINT MID$(NAM$,I,1):J=J+1:NEXT:IF F=1 THEN RETURN ELSE J=J+1:LOCATE J,1:PRINT " ":J=J+1:LOCATE J,1:PRINT " ":J=J+1:LOCATE J,1:PRINT " ":J=J+1:LOCATE J,1:PRINT " ":L=FRE(""):RETURN
3380 Q=(I*2)+1:R=(J*3)+3
3440 IF X(I,J)=9 THEN COLOR 7,BB:LOCATE Q,R,0:PRINT CHR$(15):GOSUB 3610:RETURN
3450 IF X(I,J)=7 THEN COLOR CW,BB:LOCATE Q,R,0:PRINT "B":GOSUB 3570:RETURN
3460 IF X(I,J)=5 OR X(I,J)=6 THEN COLOR BRW,BB:LOCATE Q,R,0:PRINT "A":GOSUB 3570:RETURN
3470 IF X(I,J)=2 OR X(I,J)=3 OR X(I,J)=4 THEN COLOR GW,BB:LOCATE Q,R,0:PRINT "D":GOSUB 3570:RETURN
3480 IF X(I,J)=1 THEN COLOR RW,BB:LOCATE Q,R,0:PRINT "S":GOSUB 3570:GOSUB 3590
3490 RETURN
3570 IF MUSFG=1 THEN RETURN
3580 FOR O=1 TO 4:PLAY "o0xmus$;o1xmus$;o3xmus$;":IF O=1 OR O=3 THEN COLOR ,,YW ELSE COLOR ,,BAK
3585 NEXT:RETURN
3590 IF MUSFG=1 THEN RETURN
3600 FOR O=1 TO 6:PLAY "mbl64t255o0co6do1eo3go0ao2bo3ba#ag#gf#fed#dc#co0cafgo1do2aeo3bo0go1ab":IF O=1 OR O=3 OR O=5 THEN COLOR ,,YW ELSE COLOR ,,BAK
3605 NEXT:RETURN
3610 IF MUSFG=1 THEN RETURN
3620 FOR O=1 TO 3:PLAY "mbl64t255o0co3do1eo3go0ao2b":NEXT:RETURN
3630 FOR J=1 TO 10
3640 FOR I=1 TO 10
3650 IF X(I,J)<>0 THEN MUSFG=1:IF X(I,J)=SHIP THEN PLAY "mbl16o3gc":GOSUB 3380:MUSFG=0 ELSE GOSUB 3380:MUSFG=0
3660 NEXT
3670 NEXT
3680 LOCATE 22,2,0:PRINT:RETURN
3690 K=RND:GOSUB 3710:RETURN
3700 I=INT(10*(RND+.1)):J=INT(10*(RND+.1)):IF X(I,J)<>0 THEN 3700 ELSE RETURN
3710 GOSUB 3700
3720 R=S:IF R<=0 THEN RETURN
3730 IF K>.5 THEN 3780
3740 IF X(I,J)<>0 THEN IF SW2=1 THEN GOSUB 3280:SW2=0:RETURN ELSE GOTO 3710
3750 I=I+1:R=R-1:IF R>0 THEN IF I>10 THEN IF SW2=1 THEN GOSUB 3270:SW2=0:RETURN ELSE GOTO 3710 ELSE GOTO 3740
3760 R=S:I=I-1
3770 X(I,J)=SHIP':IF WHO=1 THEN MUSFG=1:GOSUB 3380:MUSFG=0
3775 R=R-1:I=I-1:IF R>0 THEN 3770 ELSE RETURN
3780 IF X(I,J)<>0 THEN IF SW2=1 THEN GOSUB 3280:SW2=0:RETURN ELSE GOTO 3710
3790 J=J+1:R=R-1:IF R>0 THEN IF J>10 THEN IF SW2=1 THEN GOSUB 3270:SW2=0:RETURN ELSE GOTO 3710 ELSE GOTO 3780
3800 R=S:J=J-1
3810 X(I,J)=SHIP':IF WHO=1 THEN MUSFG=1:GOSUB 3380:MUSFG=0
3815 R=R-1:J=J-1:IF R>0 THEN 3810 ELSE RETURN
3940 A$="PERDON, pero usted ha perdido    ":A1$="con   ":GOTO 3960
3950 A$="Ud debe estar orgulloso, ha vencido":A1$=" a "
3960 COLOR 7,BB:LOCATE 24,1,0:PRINT P$;:GOSUB 5000:SCREEN ,,0,0:CLS:GOSUB 20000:CLS:LOCATE 5,2:PRINT A$:LOCATE 10,17:PRINT A1$:LOCATE 14,9:PRINT IB$;:LOCATE 16,4:PRINT "Su Puntaje":LOCATE 16,25:PRINT"Mi Puntaje"
3965 LOCATE 18,3:PRINT "Tiros":LOCATE 18,13:PRINT"=";YSHOTS;:LOCATE 18,24:PRINT "Tiros":LOCATE 18,34:PRINT "=";MSHOTS;:GOTO 4180
3970 F=1:GOSUB 3340:F=0:FOR P=1 TO 4
3980 COLOR 7,BB:LOCATE 24,1:PRINT SPACE$(39);:LOCATE 23,33:PRINT "       ";:LOCATE 23,1,0:PRINT "Ing. Ubicacion - Submarino(f,c):";:LOCATE 23,33,1:GOSUB 3220
3985 IF SW3=1 THEN 3980 ELSE IF X(I,J)<>0 THEN LOCATE 25,1:SOUND 400,4:PRINT E1$;:GOTO 3980 ELSE LOCATE 25,1
3990 PRINT SPACE$(39);:X(I,J)=1:MUSFG=1:PLAY "mbl16o3gc":GOSUB 3380:MUSFG=0:NEXT:FOR SHIP=2 TO 4
4000 COLOR 7,BB:LOCATE 23,33:PRINT "       ";:LOCATE 23,1,0:PRINT "Ing. Ubicacion - Destructor(f,c):";:LOCATE 23,34,1:GOSUB 3220:IF SW3=1 THEN 4000 ELSE IF X(I,J)<>0 THEN LOCATE 25,1:SOUND 400,4:PRINT E1$;:GOTO 4000
4010 GOSUB 3230:SW2=1:S=2:GOSUB 3720:IF SW2=0 THEN 4000 ELSE LOCATE 25,1:PRINT SPACE$(39);:GOSUB 3630:NEXT:FOR SHIP=5 TO 6
4020 COLOR 7,BB:LOCATE 23,34:PRINT SPACE$(6);:LOCATE 23,1,0:PRINT "Ing. Ubicacion Portaaviones(f,c):";:LOCATE 23,34,1:GOSUB 3220:IF SW3=1 THEN 4020 ELSE IF X(I,J)<>0 THEN LOCATE 25,1:SOUND 400,4:PRINT E1$;:GOTO 4020
4030 GOSUB 3230:SW2=1:S=3:GOSUB 3720:IF SW2=0 THEN 4020 ELSE LOCATE 25,1:PRINT SPACE$(39);:GOSUB 3630:NEXT
4040 COLOR 7,BB:LOCATE 23,34:PRINT SPACE$(6);:LOCATE 23,1,0:PRINT "Ing. Ubicacion - Acorazado (f,c):";:LOCATE 23,34,1:GOSUB 3220:IF SW3=1 THEN 4040 ELSE IF X(I,J)<>0 THEN LOCATE 25,1:SOUND 400,4:PRINT E1$;:GOTO 4040
4050 GOSUB 3230:SHIP=7:S=4:SW2=1:GOSUB 3720:IF SW2=0 THEN 4040 ELSE LOCATE 25,1:PRINT SPACE$(39);:GOSUB 3630:RETURN
4060 FOR J=1 TO 10
4070 FOR I=1 TO 10
4080 Y0(I,J)=X(I,J):X(I,J)=0:NEXT:NEXT:RETURN
4090 FOR J=1 TO 10
4100 FOR I=1 TO 10
4110 M0(I,J)=X(I,J):X(I,J)=0:NEXT:NEXT:RETURN
4140 NAM1$=PLAY1$:NAM2$=PLAY2$:GOTO 4160
4150 NAM1$=PLAY2$:NAM2$=PLAY1$
4160 COLOR 7,BB:LOCATE 24,1,0:PRINT P$;:GOSUB 5000:SCREEN ,,0,0:CLS:GOSUB 20000:CLS:LOCATE 5,4,0:PRINT "Perdon, ";NAM1$;", pero ha sido ";:LOCATE 7,10:PRINT "derrotado por ";NAM2$;:LOCATE 10,17,0:PRINT "en el ";
4170 LOCATE 13,10,0:PRINT IB$;:LOCATE 16,4,0:PRINT PLAY1$:LOCATE 16,25:PRINT PLAY2$:LOCATE 18,3:PRINT "Tiros":LOCATE 18,13:PRINT "=";YSHOTS;:LOCATE 18,24:PRINT"Tiros":LOCATE 18,34:PRINT "=";MSHOTS;
4180 YR=0:MR=0:IF YSHOTS>0 THEN YR=YSTRIKES/YSHOTS
4190 IF MSHOTS>0 THEN MR=MSTRIKES/MSHOTS
4195 YR$=STR$(CINT(YR*100))
4197 MR$=STR$(CINT(MR*100))
4200 LOCATE 19,3,0:PRINT S$;YSTRIKES;:LOCATE 19,24:PRINT S$;MSTRIKES;:LOCATE 20,3,0:PRINT H$;YR$;"%":LOCATE 20,24:PRINT H$;MR$;"%":LOCATE 23,1:PRINT "Juega otra vez (S/N)? ";:GOSUB 9000
4210 IF C$="S" THEN 500 ELSE 11000
5000 REM pressing enter
5010 AA$=INKEY$: IF AA$<>"" THEN 5010
5020 AA$=INKEY$: IF AA$="" THEN 5020
5030 IF AA$<>CHR$(13) THEN SOUND 400,4:GOTO 5020
5040 RETURN
5500 REM inputting 1,2, or 3
5510 AA$=INKEY$: IF AA$<>"" THEN 5510
5520 AA$=INKEY$: IF AA$="" THEN 5520
5530 IF AA$<>"1" AND AA$<>"2" AND AA$<>"3" THEN SOUND 400,4:GOTO 5520
5540 PRINT AA$
5550 OPT=VAL(AA$)
5560 RETURN
6000 REM inputting H or V
6010 AA$=INKEY$: IF AA$<>"" THEN 6010
6020 AA$=INKEY$: IF AA$="" THEN 6020
6030 IF AA$="h" OR AA$="H" THEN PRINT AA$;:K=1:RETURN
6040 IF AA$="v" OR AA$="V" THEN PRINT AA$;:K=0:RETURN
6045 SOUND 400,4:GOTO 6020
7000 REM inputting shot in x & y or Esc
7010 X=0:Y=0:XD=0
7020 AA$=INKEY$: IF AA$<>"" THEN 7020
7030 AA$=INKEY$: IF AA$="" THEN 7030
7035 IF AA$=CHR$(13) THEN IF Y<>0 THEN RETURN ELSE 7200
7040 IF AA$=CHR$(27) THEN GOSUB 15000: SCREEN ,,0,0:GOTO 11000
7042 IF AA$<>CHR$(8) AND AA$<>CHR$(0)+CHR$(75) THEN 7060
7045 IF X=0 THEN 7200 ELSE W=POS(0):LOCATE ,W-1,0:PRINT " ";:LOCATE ,W-1,1
7050 IF A$="," THEN A$="1":XD=0:GOTO 7030
7055 IF Y=0 THEN X=INT(X/10):A$="1":GOTO 7030 ELSE Y=INT(Y/10):IF Y=0 THEN A$=",":GOTO 7030 ELSE 7030
7060 IF AA$="," AND X=0 THEN 7200
7070 IF AA$="," THEN IF XD=1 THEN 7200 ELSE XD=1:A$=AA$:PRINT AA$;:GOTO 7030
7075 IF AA$<"0" OR AA$>"9" THEN 7200
7080 IF XD=1 THEN 7105
7085 IF X=0 AND AA$="0" THEN 7200
7090 IF X*10+VAL(AA$)>10 THEN 7200
7100 X=X*10+VAL(AA$):A$=AA$:PRINT AA$;:GOTO 7030
7105 IF Y=0 AND AA$="0" THEN 7200
7110 IF Y*10+VAL(AA$)>10 THEN 7200
7120 Y=Y*10+VAL(AA$):A$=AA$:PRINT AA$;:GOTO 7030
7200 SOUND 400,4:GOTO 7030
8000 REM *****************************************
8010 REM **  SUBROUTINE TO INPUT PLAYER'S NAME  **
8020 REM *****************************************
8025 I$=""
8030 AA$=INKEY$: IF AA$<>"" THEN 8030
8040 AA$=INKEY$: IF AA$=""  THEN 8040
8050 ASCII=ASC(AA$)
8060 IF ASCII=13 THEN IF I$="" THEN 8100 ELSE 8150
8070 IF (ASCII>64) AND (ASCII<91) THEN ASCII=ASCII+32: GOTO 8110
8080 IF (ASCII>96) AND (ASCII<123) THEN 8110
8090 IF ASCII=8 OR AA$=CHR$(0)+CHR$(75) THEN IF I$="" THEN 8100 ELSE W=POS(0): LOCATE ,W-1,0: I$=LEFT$(I$,LEN(I$)-1): PRINT " ";: LOCATE ,W-1,1: GOTO 8040
8100 SOUND 400,4: GOTO 8040
8110 IF LEN(I$)=8 THEN 8160
8120 IF LEN(I$)=0 THEN ASCII=ASCII-32: I$=CHR$(ASCII): GOTO 8140
8130 I$=I$+CHR$(ASCII)
8140 PRINT AA$;: GOTO 8040
8150 IF (LEN(I$)>0) AND (LEN(I$)<9) THEN RETURN
8160 LOCATE 24,7,0: SOUND 400,4: PRINT "Perdon, hay un maximo de  ";
8170 LOCATE 25,7,0: PRINT "8 letras para su nombre.   ";: FOR I=1 TO 2500: NEXT: LOCATE 24,1: PRINT SPACE$(39);: LOCATE 25,1: PRINT SPACE$(39);: I$="":LOCATE CL,CC,0:PRINT SPACE$(8);:LOCATE CL,CC,1:GOTO 8040
9000 REM inputting a y or n
9010 C$=INKEY$: IF C$<>"" THEN 9010
9020 C$=INKEY$: IF C$="" THEN 9020
9030 IF C$="S" OR C$="s" THEN PRINT C$;:C$="S":RETURN
9040 IF C$="N" OR C$="n" THEN PRINT C$;:C$="N":RETURN
9050 SOUND 400,4:GOTO 9020
11000 REM going back to menu
11010 CLS
11020 LOCATE 12,12,0:PRINT "Cargando MENU"
11030 CHAIN "MENU"
15000 SOUND 400,4:FOR I=1 TO 39:LN(I)=SCREEN(25,I):NEXT
15010 LOCATE 25,1,0:PRINT SPACE$(39);
15020 LOCATE 25,2,1:PRINT "Quiere finalizar el juego   (S/N)? ";
15030 A$=INKEY$:IF A$<>"" THEN 15030
15040 A$=INKEY$:IF A$="" THEN 15040
15050 IF A$="s" OR A$="S" THEN RETURN
15060 IF A$="n" OR A$="N" THEN LOCATE 25,1,0:FOR I=1 TO 39:B$=CHR$(LN(I)):PRINT B$;:NEXT:LOCATE 24,28:RETURN 7030
15070 SOUND 400,4:GOTO 15040
20000 REM ship sunk
20010 X=11:GOSUB 300:X=12:GOSUB 310:X=13:GOSUB 320:X=14:GOSUB 330
20020 LOCATE 14,31:COLOR 0,7:PRINT "v";
20030 COLOR 3,BB:LOCATE 15,1:PRINT STRING$(40,"~")
20040 FOR I=1 TO 800:NEXT
20045 FOR I=2000 TO 1000 STEP -10:SOUND I,.5:NEXT
20060 SOUND 37,0:COLOR 4,7,BB:LOCATE 14,18:PRINT CHR$(15)
20100 BAK=BB:GOSUB 3600
20110 FOR I=1 TO 1000:NEXT
20120 COLOR 7,BB:LOCATE 11,7:PRINT SPACE$(30)
20125 FOR I=1 TO 30:J=RND*100+37:SOUND J,.5:NEXT
20130 X=12:GOSUB 300:X=13:GOSUB 310:X=14:GOSUB 320
20140 FOR I=1 TO 30:J=RND*100+37:SOUND J,.5:NEXT
20150 LOCATE 12,7:PRINT SPACE$(30)
20160 X=13:GOSUB 300:X=14:GOSUB 310
20170 FOR I=1 TO 30:J=RND*100+37:SOUND J,.5:NEXT
20180 LOCATE 13,7:PRINT SPACE$(30)
20190 X=14:GOSUB 300
20200 FOR I=1 TO 30:J=RND*100+37:SOUND J,.5:NEXT
20210 LOCATE 14,7:PRINT SPACE$(30)
20220 FOR I=1 TO 2000:NEXT
20230 RETURN
21000 'turn numlock off
21010 DEF SEG=&H40:POKE &H17,PEEK(&H17) AND 223
21020 RETURN
22000 'turn numlock on
22010 DEF SEG=&H40:POKE &H17,PEEK(&H17) OR 32
22020 RETURN
